<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->

<link href="/Public/Admin/static/h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/static/h-ui.admin/css/H-ui.login.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/static/h-ui.admin/css/style.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/lib/Hui-iconfont/1.0.8/iconfont.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/static/h-ui.admin/skin/default/skin.css" id="skin" />

<script type="text/javascript" src="/Public/Admin/lib/jquery/1.9.1/jquery.min.js"></script> 

<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title></title>
<meta name="keywords" content="H-ui.admin v3.1,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
<meta name="description" content="H-ui.admin v3.1，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<body>
	

<style>
.search {width: 400px;height: 140px;border: 1px solid blue;position: absolute;top:50%;left:50%;margin: -70px 0 0 -200px;}
.search h3{margin:4px;padding:0;padding-left:15px;font-size: 15px;}
.search input{width:200px;height:30px;line-height:30px;}
.search form{position:absolute;top:50%;left:50%;margin:-30px 0 0 -100px;}
.search ul li a{text-indent:7px;display:block;width:100%;height: 100%;background: #f7f7f7;}
.search ul li a:hover{text-decoration: none;}
</style>

<div>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 博客管理 <span class="c-gray en">&gt;</span> 博客列表</nav>
	<?php if(I('get.id') == ''): ?><div class="search">
			<h3>搜索栏目</h3>
			<form>
			<input class="input-text" autocomplete="off" type="text" id="cat_name" />
			<ul>
			</ul>
			</form>
		</div>
	<?php else: ?>
	
	<div class="page-container">
		<div class="text-c"> 日期范围：
			<form action="" method="get">
				<input type="text" onfocus="WdatePicker()" name="logmin" class="input-text Wdate" style="width:120px;" value="<?php echo ($_GET['logmin']); ?>">
				-
				<input type="text" onfocus="WdatePicker()" name="logmax" class="input-text Wdate" style="width:120px;" value="<?php echo ($_GET['logmax']); ?>">
				<input type="text" name="blog_name" id="" placeholder=" 博客名称" style="width:250px" class="input-text" value="<?php echo ($_GET['blog_name']); ?>">
				<button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜博客</button>
			</form>
		</div>
		<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"><a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> <a class="btn btn-primary radius" onclick="product_add('添加产品','<?php echo U('addBlog',array('id'=>$id));?>')" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加博客</a></span> <span class="r">共有数据：<strong>54</strong> 条</span> </div>
		<div class="mt-20">
			<table class="table table-border table-bordered table-bg table-hover table-sort">
				<thead>
					<tr class="text-c">
						<th width="40"><input name="" type="checkbox" value=""></th>
						<th width="40">ID</th>
						<th width="60">博客名称</th>
						<th width='60'>来源</th>
						<th width='60'>关键字</th>
						<th width="100">发布时间</th>
						<th width="60">阅读次数</th>
						<th width="100">操作</th>
					</tr>
				</thead>
				<tbody>
				<?php if(is_array($blogs)): $i = 0; $__LIST__ = $blogs;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><tr class="text-c va-m">
						<td><input name="" type="checkbox" value=""></td>
						<td><?php echo ($v['id']); ?></td>
						<td><?php echo ($v['title']); ?></td>
						<td class="text-l"><?php echo ($v['source']); ?></td>
						<td class="text-l"><?php echo getKeyWords($v['id']);?></td>
						<td><?php echo date('Y-m-d H:i:s',$v['time']);?></td>
						<td class="td-status"><?php echo ($v['count']); ?></td>
						<td class="td-manage">
						<a style="text-decoration:none" class="ml-5" onClick="product_edit('产品编辑','<?php echo U('addBlog',array('id'=>$id,'blog_id'=>$v['id']));?>','10001')" href="javascript:;" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a> 
						<a style="text-decoration:none" class="ml-5" onClick="product_del(this,'10001','<?php echo U('delete',array('blog_id'=>$v['id']));?>')" href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a></td>
					</tr><?php endforeach; endif; else: echo "" ;endif; ?>
					<?php if($totalPages > 1): ?><tr><td colspan="7"><?php echo ($show); ?></td></tr><?php endif; ?>
				</tbody>
			</table>
		</div>
	</div><?php endif; ?>
</div>


<script type="text/javascript">

$('#cat_name').keyup(function (){
	$.get('<?php echo U("search");?>',{cat_name:$(this).val()},function (data){
		
		//console.log(data);
		$('.search ul').html(data);
	});
})

$(document).ready(function(){
	var t = $("#treeDemo");
	//t = $.fn.zTree.init(t, setting, zNodes);
	//demoIframe = $("#testIframe");
	//demoIframe.on("load", loadReady);
	var zTree = $.fn.zTree.getZTreeObj("tree");
	//zTree.selectNode(zTree.getNodeByParam("id",'11'));
});

/*产品-添加*/
function product_add(title,url){
	var index = layer.open({
		type: 2,
		title: title,
		content: url,
		area : ['100%','100%']
	});
	layer.full(index);
}
/*产品-查看*/
function product_show(title,url,id){
	var index = layer.open({
		type: 2,
		title: title,
		content: url
	});
	layer.full(index);
}



/*产品-编辑*/
function product_edit(title,url,id){
	var index = layer.open({
		type: 2,
		title: title,
		content: url
	});
	layer.full(index);
}

/*产品-删除*/
function product_del(obj,id,url){
	layer.confirm('确认要删除吗？',function(index){
		$.ajax({
			type: 'POST',
			url: url,
			dataType: 'json',
			success: function(data){
				if(data == 1){
					$(obj).parents("tr").remove();
					layer.msg('已删除!',{icon:1,time:1000});
				}else {
					layer.msg('删除失败!',{icon:5,time:1000});
				}
				
			},
			error:function(data) {
				
			},
		});		
	});
}
</script>

	
<script type="text/javascript" src="/Public/Admin/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/Public/Admin/static/h-ui.admin/js/H-ui.admin.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/jquery.validation/1.14.0/messages_zh.js"></script>

<script type="text/javascript" src="/Public/Admin/lib/webuploader/0.1.5/webuploader.min.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/ueditor/1.4.3/ueditor.config.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/ueditor/1.4.3/ueditor.all.min.js"> </script> 
<script type="text/javascript" src="/Public/Admin/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
</body>
</html>